home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1999 #2 / Amiga Plus CD - 1999 - No. 2.iso / System-Boost / Profi Tools / DiskSpeed / DiskSpeed.doc < prev    next >
Text File  |  1998-07-30  |  26KB  |  492 lines

  1.  
  2.                           DiskSpeed v4.2
  3.                           ScsiSpeed v4.2
  4.                                 by
  5.                            Michael Sinz
  6.  
  7.            Copyright (c) 1989-1992 by MKSoft Development
  8.  
  9.                        MKSoft Development
  10.                        163 Appledore Drive
  11.                        Downingtown, PA 19335
  12.  
  13.  Yes, this is yet another disk speed testing program, but with a few
  14.  differences.  It was designed to give the most accurate results of the
  15.  true disk performance in the system.  For this reason many of
  16.  DiskSpeed's results may look either lower or higher than current disk
  17.  performance tests.
  18.  
  19. ******************************************************************************
  20. *                                                                            *
  21. *      Reading legal mush can turn your brain into guacamole!                *
  22. *                                                                            *
  23. *              So here is some of that legal mush:                           *
  24. *                                                                            *
  25. * Permission is hereby granted to distribute this program's source           *
  26. * executable, and documentation for non-commercial purposes, so long as the  *
  27. * copyright notices are not removed from the sources, executable or          *
  28. * documentation.  This program may not be distributed for a profit without   *
  29. * the express written consent of the author Michael Sinz.                    *
  30. *                                                                            *
  31. * This program is not in the public domain.                                  *
  32. *                                                                            *
  33. * Fred Fish is expressly granted permission to distribute this program's     *
  34. * source and executable as part of the "Fred Fish freely redistributable     *
  35. * Amiga software library."                                                   *
  36. *                                                                            *
  37. * Permission is expressly granted for this program and it's source to be     *
  38. * distributed as part of the Amicus Amiga software disks, and the            *
  39. * First Amiga User Group's Hot Mix disks.                                    *
  40. *                                                                            *
  41. ******************************************************************************
  42.  
  43. DiskSpeed 4.2 is a minor update release that also adds ScsiSpeed to the
  44. distribution.  ScsiSpeed is much like DiskSpeed except it does raw device
  45. reading of the device in question.  See end of this file for more details.
  46.  
  47. ------------------------------------------------------------------------------
  48.  
  49. DiskSpeed 4.1 brings a whole new set of disk drive performance testing
  50. technologies to the game.  These tests, along with smart usage of the
  51. results will give you a very good indication of the performance of
  52. a disk subsystem in the Amiga enviorment.
  53.  
  54. DiskSpeed 4.1 is now fully configurable and can run from an Icon or
  55. from the CLI.  From the CLI, you have a choice as to if you want the
  56. graphical user interface to the program.
  57.  
  58. From Workbench, you can start DiskSpeed 4.1 from its tool icon with
  59. the settings within the tooltype of that icon.  You can also start
  60. DiskSpeed from a project icon and it will use the setting from that
  61. icon's tool types.  (Example project icon included)
  62.  
  63. Two of the options in DiskSpeed 3.1 have been removed for DiskSpeed 4.
  64. CPU Stress testing started out as a good test but ended up becoming
  65. meaningless as the drive manufactures modified the task priorities of
  66. their drives.  However, DiskSpeed 4 went to a much better method:  The
  67. CPU availability index.  This is calculated via a simple task that runs
  68. at a very low priority.  DiskSpeed takes a reading of the system's
  69. performance while idle and uses that reading to determin how much of
  70. the system's CPU is in use during each of the tests.  In addition to
  71. providing better results, it also keeps the CPU in a busy state
  72. and thus could cause a difference in drive performance.
  73.  
  74. The other feature, DMA stress, has been removed and no direct replacement
  75. is available yet.  The reason there is little that can be done is because
  76. under Release 2 of the operating system the Workbench screen is no longer
  77. a fixed resolution and mode.  This means that using DiskSpeed in different
  78. workbench screen modes will cause a difference in results.  However, it
  79. also means that it will let the user see the performance of the system
  80. with the display mode he uses.  (Most likely)  I am currently investigating
  81. how to implement a safe and reliable DMA stress for a future DiskSpeed.
  82. If something can be found that works in 1.3 I may release a DiskSpeed 4.2
  83. that contains this.  Currently there has been no good way found yet.
  84. (When testing under 2.0 you can switch to the display mode you wish to test
  85. in and try that result.  A 16-colour high-resolution overscanned display
  86. will work out as a good test of custom chip DMA vs the hard drive)
  87.  
  88. DiskSpeed 4.x will be the last 1.2/1.3 compatible version of DiskSpeed.
  89. As of this point in time, no new DiskSpeed is planned, but if another
  90. version is made, it will require AmigaOS Release 2 as a minimum
  91. operating system version.
  92.  
  93. The DiskSpeed command line options look much like the standard ReadArgs()
  94. options of Release 2.  They are, however, not the ReadArgs() since that
  95. feature is only available as of Release 2.
  96.  
  97.  
  98. These key words are also available from the TOOLTYPES of the icon.
  99.  
  100. * DRIVE/K    - select drive  (Default is current directory)
  101.     You can use either 'DRIVE <path>'  or  'DRIVE=<path>'
  102.  
  103. * COMMENT/K    - set comment string
  104.     You can use either 'COMMENT <comment>'  or  'COMMENT=<comment>'
  105.  
  106. * ALL/S        - select all tests
  107.     This turns on all of the tests below
  108.  
  109. * DIR/S        - setect DIR tests
  110. * SEEK/S    - select SEEK tests
  111.  
  112. * CHIP/S    - select CHIP memory buffer tests
  113. * FAST/S    - select FAST memory buffer tests
  114.     You can select both and DiskSpeed will then do a test pass
  115.     with each type of memory.
  116.  
  117. * LONG/S    - select LONG aligned tests
  118. * WORD/S    - select WORD aligned tests
  119. * BYTE/S    - select BYTE aligned tests
  120.     You can select any combinations of the above.  DiskSpeed
  121.     will do a test pass with each one.  These combine with
  122.     the memory type above to create up to 6 test passes.
  123.  
  124. * BUF1/K/N    - select buffer size 1    (Default = 512)
  125. * BUF2/K/N    - select buffer size 2    (Default = 4096)
  126. * BUF3/K/N    - select buffer size 3    (Default = 32768)
  127. * BUF4/K/N    - select buffer size 4    (Default = 262144)
  128.     Will let you select the buffer sizes for the tests.
  129.     To eliminate a buffer test, set the buffer to 0.
  130.     You can use either 'BUF1 <num>'  or  'BUF1=<num>'
  131.  
  132. * WINDOW/S    - use the GUI even though started from the CLI
  133.  
  134. * MINTIME/K/N    - Selects the number of seconds to run each test. (1 to 500)
  135.   New keyword that lets you select the minimum amount of time any test takes.
  136.   This applies to all tests except for the Directory entry create and delete
  137.   tests.  Also, note that after the file create speed test, a full 256K file
  138.   is created and this can, on slow systems take some time.
  139.  
  140. * NOCPU/S    - Turns off the CPU available task.
  141.   New keyword that lets you turn off CPU percentage collection.  This is so
  142.   that the secondary task is not created.  Seems that just having this task
  143.   around can be enough to throw the performance of the system way off.  The
  144.   difference in time it takes to task-switch from STOP to the harddisk driver
  145.   and from a background task and the harddisk driver is sometimes just enough
  146.   to cause a rotation on the disk to be missed.  This feature may well be
  147.   removed, but the difference in the numbers is rather interesting.  (The
  148.   background task is at -127 priority...)
  149.  
  150.  
  151.  
  152. Below is a small part of an article I wrote for AmigaWorld Tech Journal
  153. Volume 1, Issue 5.
  154.  
  155. To get the full article and diagrams, you can contact AmigaWorld
  156. at 1-800-343-0728.  Other back issues are also available.
  157.  
  158.     Michael Sinz
  159.     MKSoft Development
  160.  
  161. ---------------------------------------------------------------------------
  162.  
  163. In search of speed...
  164.  
  165. As the industry moves to even faster drives and even larger data
  166. requirements, high speed drives and drive support will become a
  167. required feature of computers.  Multimedia is one of the application
  168. areas where high performance, large storage devices are required.
  169.  
  170. The Amiga did not have good hard drive support until the "Fast Filing
  171. System" came out.  However, now that it is here, the performance has
  172. proven that the Amiga is not just a graphics box.  The performance of
  173. the Fast Filing System and the hardware of the Amiga's hard drive
  174. controllers have pushed the limits of data transfer speeds.  With a
  175. good controller, many times the performance is limited by the speed of
  176. the data coming from the drive itself.
  177.  
  178.  
  179. Disk Drives:  How fast are they really
  180.  
  181. 500 K-bytes/second.  34 files/second.  This drive.  That controller.
  182. DMA. Non-DMA.  Multitasking friendly.  Video speed.  Millisecond access
  183. times. SCSI.  ST-506.  AT.  IDE.  Adaptec.  OMTI.
  184.  
  185. The amount of confusing, conflicting, and just plain wrong information
  186. about hard drives is rather extreme.  Maybe the reason for this is
  187. because the Amiga used to have slow hard drives.  Maybe it is because
  188. the Amiga now has some of the fastest hard drives in the industry.
  189. Some of it is also due to a misunderstanding of what the various terms
  190. and numbers mean.  So, what do these numbers mean?  How do they relate
  191. to how fast the system really is? And why are they what they are?
  192.  
  193. First, what does a disk drive, or more specifically, a hard disk drive
  194. really do?  Yes, we know it stores data, but there must be more
  195. involved in the process.  So, let us first look at some of the basic
  196. technical issues.
  197.  
  198. Data within a computer is just a series of 1s and 0s. (I know, we all
  199. know that already)  To store this data, the computer must, in some way,
  200. be able to take the 1s and 0s and record them such that they can be
  201. read back as the same pattern of 1s and 0s that were written.  One of
  202. the most popular methods of doing this is magnetic recording.  In much
  203. the same way as audio tape records sounds and plays it back, the
  204. computer generates a signal, or sound, that is recorded and when played
  205. back can be decoded and understood by the computer.  Computers did this
  206. on magnetic tape, magnetic drums, magnetic plated media, spinning
  207. magnetic tape (what became the floppy), and sealed magnetic plated
  208. media.  Through the history of computers, this has been one of the most
  209. complex and fastest advancing fields.  It was not much more than 10
  210. years ago when sealed media hard disk drives (known as Winchesters)
  211. were getting a whopping 5 to 10 million bytes on 8-inch drives. Today,
  212. on small 3.5-inch drives, over 1,000 million bytes are being stored.
  213.  
  214.  
  215. Measuring performance
  216.  
  217. Measuring the performance of a disk subsystem is a rather interesting
  218. science.  In addition to the physical limitations of the drive and
  219. controller, there are issues of software technology at the drive
  220. controller level, the filesystem level, and the operating system level.
  221. In addition, many of the standard testing issues come into play, such
  222. as accuracy of the test, accuracy of the observation, applicability of
  223. the test, etc.
  224.  
  225. The accuracy of the test can be defined rather exactly.  On the Amiga,
  226. the system has a timer that has a 1/60 second (1/50 in PAL) resolution.
  227. This comes out to roughly 0.02 seconds.  Thus, any given time reading
  228. will be only accurate to within +/- 0.02 seconds.  In order to test the
  229. speed of the tests, the time must be read at the beginning and at the
  230. end of the test. This results in +/- 0.04 seconds of accuracy.  Thus,
  231. in order to make the test have a +/- 1% accuracy, it would have to run
  232. for a minimum of 4 seconds.
  233.  
  234. The accuracy of the observation is much more difficult to quantify. The
  235. issue here is that in doing the observation, the test, and thus the
  236. results, are affected.  The best that can be done is to try to minimize
  237. the effect of observing the test while not compromising the quality of
  238. the observations.
  239.  
  240. The last issue:  the applicability of the test.  What this really means
  241. is how well the test (and the results of the test) relates to the
  242. real-use performance of the drive.  This is in many ways more important
  243. that the other two issues as without reasonable applicability, the test
  244. results would be useless.
  245.  
  246. With DiskSpeed, the disk performance test software that MKSoft
  247. Development has been developing, attention has been paid to make the
  248. tests both accurate and realistic.  DiskSpeed 3.1 has proven itself as
  249. being accurate and has become the standard by which Amiga hard disks
  250. and controllers are judged. With DiskSpeed 4.1 a whole new set of tests
  251. will be possible.
  252.  
  253.  
  254. DiskSpeed - The standard in the Amiga world
  255.  
  256. I had first developed DiskSpeed due to the fact that other disk drive
  257. performance testers were either highly inaccurate or did not relate
  258. well to real-world disk drive usage.  The accuracy issues are easy to
  259. solve, however the applicability issues took some thinking.
  260.  
  261. The accuracy issues were solved, in DiskSpeed 3.1, by making the tests
  262. take a long time.  This made sure that the clock's accuracy did not
  263. adversely affect the results of the test.  In addition, the tests were
  264. done with as clean of a software design as possible.
  265.  
  266. With DiskSpeed 4.1, I have developed a new technology that can
  267. automatically size the test time to give as accurate a result as
  268. possible.  It was important that this was only done in the appropriate
  269. tests as some tests radically change their results if they are run for
  270. more iterations.
  271.  
  272. The more important, and more difficult, part of designing a set of
  273. tests is to come up with ones that will show results that apply to the
  274. real world. In that direction, none of the tests use anything other
  275. than standard AmigaDOS file I/O calls.  Some people ask me to add a
  276. test that does direct device I/O.  However, no application would do
  277. direct device I/O to open/read/write/close/delete a file.  It would not
  278. only be ridiculous, but the amount of work required to write a
  279. filesystem is well beyond what an application developer needs to spend
  280. their time on.
  281.  
  282. Now that the tests are to only do AmigaDOS I/O, what needs to be
  283. tested?  This is where some knowledge of the physical limitations of
  284. the disk drives and how application software works is needed.
  285.  
  286. As many of you already know, the Amiga's filing system is very powerful
  287. and flexible.  Much of this power is from the way data is laid out on
  288. the disk.  However, as I am sure you also know, this layout makes some
  289. things a bit slower.  The most noticeable is that of listing a
  290. directory.  Since this is something that causes the system to read many
  291. blocks of data, many from different areas on the disk, and since many
  292. (most) applications and all users run into this performance issue
  293. during every-day use, a test that would measure the performance of the
  294. drive/controller combination when scanning a directory would provide
  295. numbers that directly relate to user experience.
  296.  
  297. In addition to scanning directories, it is important to be able to
  298. create new directory entries, find directory entries, and delete them.
  299. Again, these are situations that users run into every time they use an
  300. application that does anything with a disk.  All together, these tests
  301. are designed to show the performance of the filesystem's directory
  302. structure.  Note that in order to make these tests fair, the number of
  303. files created in the test directory is always the same.  The speed of
  304. access in a directory structure changes as the number of files change
  305. and if this test were to auto-size itself based on the speed of the
  306. device, the results would no longer be valid.
  307.  
  308. Another test that help show the performance of the filesystem and
  309. device driver is the Seek/Read test.  This test helps show how well a
  310. database application may run as database operations tend to be very
  311. disk bound and tend to access various locations with a large file. The
  312. Seek/Read test reads small chunks from the file at various locations
  313. within the file.  The speed with which the filesystem can find the
  314. correct data location within the file and then read a part of it is
  315. directly tested by this test.  (Note that the DiskSpeed 3.1 Seek/Read
  316. test was rather simplistic and produced uninteresting numbers.)
  317.  
  318. The final tests, are the basic file data read and write tests.  There
  319. are three of these:
  320.  
  321. File Write/Create:  this is where a new file is created and the data is
  322. filled in.  The speed of this is dependant on how fast the filing
  323. system can locate new empty blocks of disk space for the file.
  324.  
  325. File Write:  this is where an old file is written to.  The performance
  326. here is determined by how well the filing system deals with rewriting
  327. the data in a file that already exists.  This will usually be faster
  328. than the Write/Create test.
  329.  
  330. File Read:  this is where an old file is read from.  The performance
  331. here is determined by how quickly the filing system finds the data
  332. blocks of a file.
  333.  
  334. With DiskSpeed 3.1, each of these three tests were done with various
  335. buffer sizes ranging from 512-bytes to 262144-bytes.  DiskSpeed 4.1
  336. adds a few twists to this in that each test will also happen on
  337. LONGWORD aligned buffers, WORD aligned buffers, and BYTE aligned
  338. buffers.  Each test is then done in FAST memory and in CHIP memory (if
  339. you have them available.)  Also new for DiskSpeed 4.1 is the feature
  340. with which you can select the sizes of the tests.
  341.  
  342. While the larger size buffers are nice to play with, it is important to
  343. remember that most older applications only use a 512-byte buffer. Many
  344. of the newer applications are using 4096-byte buffers as the speed
  345. improvement by just increasing the amount of data read in one I/O call
  346. is rather significant.  DiskSpeed 3.1 helped show this fact.
  347.  
  348. In addition to the basic tests, DiskSpeed 3.1 let you turn on DMA and
  349. CPU stress factors.  The DMA feature would increase the amount of
  350. bandwidth the video control chips were using.  This was in order to
  351. show how well the drive/controller combination would work in a video
  352. environment.  The CPU stress was an attempt to simulate heavy work
  353. loads in the multi-tasking environment the Amiga provides.
  354.  
  355. With DiskSpeed 4.1, the CPU stress test has been removed.  It turned
  356. out to produce results that did not mean much.  However, to take its
  357. place is a CPU availability value that is reported for each test. This
  358. is a rough calculation of the available CPU percentage during the test.
  359. This is a very useful number as it will tell you if there is enough CPU
  360. time available to decompress a picture while loading the next one or to
  361. handle user input during disk I/O.
  362.  
  363. Observing a test always has an impact on the results.  This is a known
  364. fact.  DiskSpeed is no able to get around this fact.  In doing the CPU
  365. availability checking, the performance of the system may change.  This
  366. is due to the fact that just the act of counting the CPU time will
  367. cause some CPU time to be used and will change the dynamics of the
  368. system.  However, if all tests are done the same way, the relative
  369. merits of the drives under test will still be valid.
  370.  
  371.  
  372. Why is ... ?
  373.  
  374. So, now that we have some results, why are they like they are?
  375.  
  376. Why are small transfers so much slower?
  377. There are a number of reasons.  One of the major ones is the layout of
  378. data on the disk.  The sectors may be lade out on the disk in a number
  379. of ways. When a large transfer happens, it asks for the disk drive to
  380. send the data for a number of blocks.  If these were blocks 1 to 8, the
  381. drive could read all of these blocks in one revolution of the disk.
  382. (given a 1:1 interleave) However, if a program asks for only one block
  383. worth of data at a time, the time between the blocks could be too much
  384. and the next block will have passed by the head of the disk. Then the
  385. disk will have to rotate around until the right block was available
  386. again.  In the example, that would mean that a read of 8 blocks done 1
  387. at a time would take 7 full revolutions once the first block was
  388. transferred.  This makes for a total of 7 times slower than the
  389. transfer that asked for 8 blocks at once.  This is worst case. Many
  390. drives today have some caching and read-ahead that will help minimize
  391. this.
  392.  
  393. Why are the results inconsistent from one test to another?
  394. Disk performance testing is a rather complex task.  Without special
  395. equipment, many things can not be done.  When DiskSpeed does its tests,
  396. it does not know the exact location of the disk relative to the drive
  397. heads. This means that there will be some difference in timing between
  398. the time the drive is asked to read (or write) a block and the time
  399. that block is under the read/write head.  This time is known as
  400. rotational latency.  The faster the drive spins, the lower this time is.
  401.  
  402. Why does the CPU test make the drive speed so much slower?
  403. Depending on the method used to implement the controller software, the
  404. CPU test task, which runs at -127 priority, becomes extra overhead.
  405. The difference in speed may be rather small from the CPU standpoint,
  406. but it may be just enough in order to fall pray to the rotational
  407. latency problem.  The overhead difference is that when no task is
  408. running, waking up a task is just starting that task again. If,
  409. however, another task is running at the same time, the old task must
  410. first be put to sleep and this work can be just enough time to make the
  411. system miss the next block that is coming around and would then need to
  412. wait until it comes around again.
  413.  
  414. Why does drive performance change as the drive gets older?
  415. Drive performance does not really change due to the age of the disk.
  416. However, as files are written to the disk and then later removed, the
  417. empty areas of the disk become scattered.  When the disk is then
  418. tested, the system will have to seek to each of the locations where
  419. part of the data is stored.  This adds seek time, rotational latency,
  420. control overhead, and processor overhead as this information is handled.
  421.  
  422. Why are write speeds sometimes faster than read?
  423. Well, the way the drive works can have a major impact on this.  If the
  424. drive has a cache, a write could be sent to the cache while the drive
  425. is still waiting for the read/write head to get the position it wanted.
  426. Thus, the disk can say that the write is completed while it is not
  427. quite done.  During the time the system is getting ready for the next
  428. write, the drive will hopefully have sent the last write to the disk.
  429.  
  430. What number is most important?
  431. This is a hard question.  It would depend on your application and how
  432. you use your machine.  If you many times do directory listings or
  433. create files, it would be best to look at the directory manipulation
  434. tests; these include Files-per-second create/open/scan/delete.  One of
  435. the numbers that is most important to me is the small buffer
  436. performance.  That is, the performance of the drive/controller on
  437. buffered reads between the sizes of 512 bytes to 4096 bytes)  These two
  438. buffer sizes are much more representative of the size of the read/write
  439. buffers of most applications.  While the large buffer sizes are
  440. important to graphics and animation persons where high speed
  441. performance to large files is a major factor.  However, this is only
  442. useful if the file can be read as one big chunk.
  443.  
  444. Why does the test sometimes show more that 100% available CPU?
  445. Due to the fact that the CPU availability had to be measured to get a
  446. reading of how much total CPU there was, the measurement could have
  447. been a small amount incorrect.  The measurement code tries its best to
  448. get an accurate measurement but this is not always possible.  It will
  449. notice (most of the time) when accurate measurements are not possible
  450. and turn off the CPU testing since it would be meaningless.
  451.  
  452.  
  453. With the addition of the CPU availability numbers, a much more complete
  454. picture of drive and system performance can be obtained.  As multimedia
  455. becomes more important, the performance combination of high drive speed
  456. along with large amounts of available CPU power will be what makes it
  457. all possible.
  458.  
  459. With DiskSpeed 4.1, it will be possible for developers to make sure
  460. that the design of their hardware/software lives up to the performance
  461. needs of their users.  It will also give the data that proves the
  462. performance of the system for real work.  Applications such as database
  463. servers, file servers, and multimedia require as much performance as
  464. possible in the drive subsystem. The Amiga has the performance to
  465. outshine most other platforms in this area.
  466.  
  467. ******************************************************************************
  468. ******************************************************************************
  469. ******************************************************************************
  470.                 ScsiSpeed 4.2
  471.  
  472. ScsiSpeed was written due to the demand for more details on the raw
  473. performance of the drives connected to the system.  What ScsiSpeed does is
  474. use low-level device I/O to read the disk starting at block 0 and working up.
  475. ScsiSpeed, with a reasonable test time such as 20 seconds, will show the
  476. true sustained performance of the drive/interface combination without the
  477. overhead of the filesystem and AmigaDOS.
  478.  
  479. Basically, the usage of ScsiSpeed is the same as DiskSpeed except for options
  480. which do not apply.  (Such as DIR and SEEK tests, etc)
  481.  
  482. Also, the device/drive specification is different.  You must give the device
  483. name (such as scsi.device or trackdisk.device) and the unit number as follows:
  484.  
  485. scsi.device:6        <- This would be unit 6 of scsi.device (default)
  486. trackdisk.device:0    <- This would be DF0:
  487.  
  488. Note that due to some controller limitations, only long-aligned read tests
  489. are done.  Also, ScsiSpeed does not write to the disk and thus will not
  490. destroy any data on the disk.  This also means that it can test devices
  491. such as CD-ROM and WORM disks.
  492.